# -*- coding: utf-8 -*-
from abc import ABC
from app.models.cod import *
from app.views import CommonHandler
from app.configs import global_config


class CodeHandler(CommonHandler, ABC):
    async def get(self):
        data = {
            'Loosened': mapping(Loosened),
            'Candstone': mapping(Sandstone),
            'Conglomerate': mapping(Conglomerate),
            'Breccia': mapping(Breccia),
            'Mudstone': mapping(Mudstone),
            'Shale': mapping(Shale),
            'Limestone': mapping(Limestone),
            'Dolomite': mapping(Dolomite),
            'Mineral': mapping(Mineral),
            'Coal': mapping(Coal),
            'Magma': mapping(Magma),
            'MixedMetamorphic': mapping(MixedMetamorphic),
            'AgeSystem': mapping(AgeSystem),
            'AgeSeries': mapping(AgeSeries),
            'AgeGroup': mapping(AgeGroup),
            'Lithology': mapping(Lithology),
            'Sign': mapping(Sign),
            'MapType': mapping(MapType),
            'MapAssembly': mapping(MapAssembly),
            'MapType2Assembly': mapping(MapType2Assembly),
            'TunnelType': mapping(TunnelType),
            'TunnelPointType': mapping(GuidePointType),
            'SectionShape': mapping(SectionShape),
            'StructType': mapping(StructType),
            'StructCode': mapping(StructCode),
            'WorkingFaceType': mapping(WorkingFaceType),
            'WorkingFaceCode': mapping(WorkingFaceCode),
            'DrivingTechnology': mapping(DrivingTechnology),
            'ThreeArea': mapping(ThreeArea),
            'FaultType': mapping(FaultType),
            'HoleInclinationMethod': mapping(HoleInclinationMethod),
            'EquipmentSystem': mapping(EquipmentSystem),
            'MonitorSensorType': mapping(MonitorSensorType),
            'MonitorObject': mapping(MonitorObject),
            'PipelineType': mapping(PipelineType),
            'SensorType': mapping(Sensor),
            'SensorStatus': mapping(SensorStatus)
        }
        await self.response(data=data)


class ConfigHandler(CommonHandler, ABC):
    async def get(self):
        await self.response(data=global_config)
